Median of Two Sorted Arrays - Leetcode 4Problem - Leetcode Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). Example 1: Input: nums1 = [1,3], nums2 = [2] Output: 2.00000 ...Jan 7, 2024 · 3 min readjyotirmoy.hashnode.dev
Time Based Key-Value Store - Leetcode 981Problem - Leetcode Design a time-based key-value data structure that can store multiple values for the same key at different time stamps and retrieve the key's value at a certain timestamp. Implement the TimeMap class: TimeMap() Initializes the obje...Jan 3, 2024 · 3 min readjyotirmoy.hashnode.dev
Search in Rotated Sorted Array - Leetcode 33Problem - Leetcode There is an integer array nums sorted in ascending order (with distinct values). Prior to being passed to your function, nums is possibly rotated at an unknown pivot index k (1 <= k < nums.length) such that the resulting array is [...Jan 2, 2024 · 3 min readjyotirmoy.hashnode.dev
Find Minimum in Rotated Sorted Array - Leetcode 153Problem - Leetcode Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [0,1,2,4,5,6,7] might become: [4,5,6,7,0,1,2] if it was rotated 4 times. [0,1,2,4,5,6,7] if it was rotated 7 t...Nov 13, 2023 · 3 min readjyotirmoy.hashnode.dev
Koko Eating Bananas - Leetcode 875Koko loves to eat bananas. There are n piles of bananas, the i<sup>th</sup> pile has piles[i] bananas. The guards have gone and will come back in h hours. Koko can decide her bananas-per-hour eating speed of k. Each hour, she chooses some pile of ban...Oct 25, 2023 · 3 min readjyotirmoy.hashnode.dev