Leetcode 59. How To Go Around A Square Matrix In Spiral OrderProblem statement Given a positive integer n, generate an n x n matrix filled with elements from 1 to n^2 in spiral order. Example 1 Input: n = 3 Output: [[1,2,3],[8,9,4],[7,6,5]] Example 2 Input: n = 1 Output: [[1]] Constraints 1 <= n <= 20. So...Jan 31, 2024 · 2 min readleetsolve.com
Leetcode 120. How To Find The Minimum Path From Top To Bottom Of A TriangleProblem statement You're provided with a triangle array. Your goal is to find the smallest possible sum of a path from the top of the triangle to the bottom. You can move to an adjacent number in the row below at each step. Specifically, if you're at...Jan 23, 2024 · 4 min readleetsolve.com
How To Find The Longest Substring Without Repeating CharactersProblem statement Given a string s, find the length of the longest substring without repeating characters. Example 1 Input: s = "abcabcbb" Output: 3 Explanation: The answer is "abc", with a length of 3. Example 2 Input: s = "bbbbb" Output: 1 Explana...Jan 16, 2024 · 3 min readleetsolve.com
How To Find The Maximal Subarray Having Distinct ElementsProblem statement You are given an array of positive integers nums and want to erase a subarray containing unique elements. The score you get by erasing the subarray is equal to the sum of its elements. Return the maximum score you can get by erasing...Jan 9, 2024 · 2 min readleetsolve.com
Common Mistakes in Coding Interviews and How to Avoid ThemCoding interviews are a pivotal part of the hiring process for software engineers and developers. These interviews assess your problem-solving skills, algorithmic thinking, and coding abilities under pressure. While coding interviews can be challengi...Jan 2, 2024 · 6 min readleetsolve.com