Python Quick Cheatsheet

This post is based on hereVariablesPython has no command for declaring a variable. A variable is created the moment you first assign a value to it. Variables do not need to be declared with any partic

- Read more -

Python Random Notes

Using max heapThe post is taken from here.We use heapq class to implement Heaps in Python. By default Min Heap is implemented by this class.To implement MaxHeap not limiting to only numbers but any ty

- Read more -

LeetCode 53: Maximum Subarray

Problem DescriptionGiven an integer array nums, find the subarray with the largest sum, and return its sum.Example 1Input: nums = [-2,1,-3,4,-1,2,1,-5,4] Output: 6 Explanation: The subarray [4,-1,2,1]

- Read more -

LeetCode 1235: Maximum Profit in Job Scheduling

Problem DescriptionWe have n jobs, where every job is scheduled to be done from startTime[i] to endTime[i], obtaining a profit of profit[i].You're given the startTime, endTime and profit arrays, retur

- Read more -

Java Miscellaneous

Sort a two-dimensional array:Suppose intervals is a two-dimensional array int[][].Arrays.sort( intervals, (a,b)->Integer.compare(a[0], b[0]) );Note how the lambda expression is writte. Or you can w

- Read more -

Basic Data Structures

OverviewThis post will cover several data structures which are important for coding interview. Definitions, implementations, and common usages will be discussed. The following data structures are incl

- Read more -

LeetCode 45: Jump Game II

Problem DescriptionYou are given a 0-indexed array of integers nums of length n. You are initially positioned at nums[0].Each element nums[i] represents the maximum length of a forward jump from index

- Read more -

Good LeetCode Problems

The post maintains a list of leetcode problems that deserve a second try after some time but are less tricky so we do not provide the solution here.43. Multiple Strings44. Wildcard Matching49. Group A

- Read more -