Day-3 Leetcode Interview Questions169. Majority Element — LeetCode (Easy) Problem Summary You are given an integer array nums of size n. Your task is to return the majority element, which is defined as: The element that appears more than ⌊ n / 2 ⌋ times It is guaranteed that a majo...Nov 17, 2025·4 min read
Day-8 Leetcode Coding Journey: Mastering Problem-Solving TechniquesLeetCode #59: Spiral Matrix II Problem Statement Given a positive integer n, generate an n x n matrix filled with elements from 1 to n^2 in spiral order. Constraints 1≤n≤20 🚀 Code Implementation class Solution(object): def generateMatrix(self,...Feb 22, 2025·1 min read
Day-2 of JavaScriptPrinting a statement in js console.log('hello world'); Variables in js The let keyword is for variables which holds values and can be changed. let message = "hello"; console.log(message) // output is hello message = "world"; console.log(message); //...Feb 19, 2025·1 min read
Day-7 Leetcode Coding Journey: Mastering Problem-Solving TechniquesLeetcode #56 Merge Intervals Problem Statement: Given a collection of intervals, merge all overlapping intervals and return an array of the non-overlapping intervals that cover all the intervals in the input. Constraints 1 ≤ intervals.length ≤ 10^4 ...Feb 19, 2025·1 min read
Day-6 Leetcode Coding Journey: Mastering Problem-Solving TechniquesLeetcode #54 Spiral Matrix 📌 Problem Statement Given an m x n matrix, return all elements of the matrix in spiral order. Constraints m==matrix.length n==matrix[i].length 1≤m,n≤10 −100≤matrix[i][j]≤100 🚀 Code Implementation class Solution(obje...Feb 16, 2025·1 min read
Day-5 Leetcode Coding Journey: Mastering Problem-Solving TechniquesLeetcode #50 Pow(x, n) 📌 Problem Statement Implement the function mypow(x, n), which calculates x^n (x raised to the power of n). Constraints −100.0<x<100.0 −2^31≤n≤2^31−1 x^n will be within the range of a 32-bit signed floating-point number. �...Feb 16, 2025·1 min read
Day-4 Leetcode Coding Journey: Mastering Problem-Solving TechniquesLeetcode #47 Permutations II 📌 Problem Statement Given a collection of numbers, nums, that might contain duplicates, return all possible unique permutations in any order. Constraints: Each number in nums can be used only once per permutation. The ...Feb 12, 2025·1 min read