Open in app

Sign In

Write

Sign In

Alkesh Ghorpade
Alkesh Ghorpade

117 Followers

Home

About

Published in Towards Dev

·3 days ago

LeetCode — First Missing Positive

Problem statement — Given an unsorted integer array nums, return the smallest missing positive integer. You must implement an algorithm that runs in O(n) time and uses constant extra space. Problem statement taken from: https://leetcode.com/problems/first-missing-positive Example 1: Input: nums = [1, 2, 0] Output: 3 Explanation: The numbers in the range [1, 2] are all…

Programming

6 min read

Programming

6 min read


Published in Towards Dev

·5 days ago

LeetCode — Reverse Nodes in k-Group

Problem statement — Given the head of a linked list, reverse the nodes of the list k at a time, and return the modified list. k is a positive integer and is less than or equal to the length of the linked list. …

Programming

6 min read

LeetCode — Reverse Nodes in k-Group
LeetCode — Reverse Nodes in k-Group
Programming

6 min read


Published in Towards Dev

·Mar 16

LeetCode — Subarray Sum Equals K

Problem statement — Given an array of integers nums and an integer k, return the total number of subarrays whose sum equals to k. A subarray is a contiguous non-empty sequence of elements within an array. Problem statement taken from: https://leetcode.com/problems/subarray-sum-equals-k Example 1: Input: nums = [1, 1, 1], k = 2 Output…

Programming

4 min read

Programming

4 min read


Published in Towards Dev

·Mar 9

LeetCode — Reverse Words in a String

Problem statement — Given an input string s, reverse the order of the words. A word is defined as a sequence of non-space characters. The words in s will be separated by at least one space. Return a string of the words in reverse order concatenated by a single space. Note that s…

Programming

7 min read

Programming

7 min read


Published in Towards Dev

·Mar 5

LeetCode — Count Good Nodes in Binary Tree

Problem statement — Given a binary tree root, a node X in the tree is named good if in the path from root to X there are no nodes with a value greater than X. Return the number of good nodes in the binary tree. Problem statement taken from: https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix Example 1: Input…

Programming

5 min read

Programming

5 min read


Published in Towards Dev

·Mar 4

LeetCode — Kth Smallest Element in a Sorted Matrix

Problem statement — Given an n x n matrix where each of the rows and columns is sorted in ascending order, return the kth smallest element in the matrix. Note that it is the kth smallest element in the sorted order, not the kth distinct element. You must find a solution with a…

Programming

8 min read

Programming

8 min read


Published in Towards Dev

·Feb 26

LeetCode — Minimum Operations to Make Array Equal

Problem statement You have an array arr of length n where arr[i] = (2 * i) + 1 for all valid values of i (i.e., 0 <= i < n). In one operation, you can select two indices x and y where 0 <= x, y < n and subtract 1 from…

Leetcode

4 min read

Leetcode

4 min read


Published in Towards Dev

·Feb 19

LeetCode — Minimize Maximum Pair Sum in Array

Problem statement — The pair sum of a pair (a, b) is equal to a + b. The maximum pair sum is the largest pair sum in a list of pairs. For example, if we have pairs (1, 5), (2, 3), and (4, 4), the maximum pair sum would be max(1 + 5…

Programming

3 min read

Programming

3 min read


Published in Towards Dev

·Feb 18

LeetCode — Difference Between Ones and Zeros in Row and Column

Problem statement — You are given a 0-indexed m x n binary matrix grid. A 0-indexed m x n difference matrix diff is created with the following procedure: Let the number of ones in the ith row be onesRowi. Let the number of ones in the jth column be onesColj. Let the number…

Programming

7 min read

LeetCode — Difference Between Ones and Zeros in Row and Column
LeetCode — Difference Between Ones and Zeros in Row and Column
Programming

7 min read


Published in Towards Dev

·Feb 16

LeetCode — Rearrange Array Elements by Sign

Problem statement You are given a 0-indexed integer array nums of even length consisting of an equal number of positive and negative integers. You should rearrange the elements of nums such that the modified array follows the given conditions: Every consecutive pair of integers have opposite signs. For all integers with the…

Programming

4 min read

Programming

4 min read

Alkesh Ghorpade

Alkesh Ghorpade

117 Followers

Software Engineer. Working ShakaCode. My portfolio https://alkeshghorpade.me

Following
  • Utkarsha Bakshi

    Utkarsha Bakshi

  • Asmita Karanje

    Asmita Karanje

  • Tenny Tomas

    Tenny Tomas

  • Archana Patil

    Archana Patil

  • Alessandro Butler

    Alessandro Butler

See all (28)

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech