Skip to content

DSA

Algorithms, Data Structures, Competitive Coding, and problems from LeetCode with complete Solution Approach, Pseudocode, and Explanation.

Contains Duplicate LeetCode JS Solution

Contains Duplicate LeetCode – JS Solution

Contains Duplicate – LeetCode problem: We need to check if the given array contains duplicates and return True if duplicates are present and False otherwise. Link: Contains Duplicate LeetCode Difficulty: Easy Examples:Input: nums = [1,2,3,2]Output: true Example 2:Input: nums = [1,2,3,4]Output: false Solution in JavaScript Here we use an object… Read More »Contains Duplicate LeetCode – JS Solution

matrix transpose c++

Transpose a Matrix

Given a matrix of N dimensions, and we need to transpose it. One of the standard problem on matrices. Don’t confuse Transpose with Rotation, the rotation is normally performed on the X-Y axis while in a transpose, the matrix is flipped on its diagonal. Example: Solution Approach This is simple… Read More »Transpose a Matrix