# Dipin krishna

## How to upgrade Ubuntu server 20.04 to Ubuntu 22.04 (latest)

1. Let’s fetch the latest version of the package list from the repositories. sudo apt update 2. Upgrade the installed packages. sudo apt upgrade 3. Upgrade the distribution and reboot the server. sudo apt dist-upgrade sudo reboot 4. Let’s make sure we have the Update Manager Core installed. sudo apt install update-manager-core 5. Let’s make… Read More »How to upgrade Ubuntu server 20.04 to Ubuntu 22.04 (latest)

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contains a single digit. Add the two numbers and return it as a linked list. You may assume the two numbers do not contain any leading zero, except the number 0 itself.… Read More »Python: Add Two Numbers – Linked List

## Python: Two Sum Problem

Given an array of integers, return indices of the two numbers such that they add up to a specific target. The below python code will return the first solution found, and assumes that no element appears twice. def twoSum(nums, target): “”” :type nums: List[int] :type target: int :rtype: List[int] “”” index_map = {} for i… Read More »Python: Two Sum Problem

## Python: Stack with Push, Pop and seek Minimum Value with O(1)

Pyhton 3 code to implement a stack with push, pop and seekMin function with time complexity of O(1) class Stack: def __init__(self): self.items = [] self.minList = [] self.min = None def push(self, item): print(“Push: “, item) self.items.append(item) if not self.min: self.min = item else: if item