Code Better

Latest Posts

Problem Statement Given a Binary tree, print out nodes in level order traversal from left to right. Approach-1 Use BFS (Breadth First Search…

Problem Statement Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d…

Problem Statement Write a function that reverses a string. The input string is given as an array of characters char[]. Do not allocate extra…

Problem Statement You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise). You have to rotate the…

Problem Statement Given an array nums, write a function to move all 0’s to the end of it while maintaining the relative order of the non…

Problem Statement Given a non-empty array of digits representing a non-negative integer, increment one to the integer. The digits are stored…

Problem Statement Given a non-empty array of integers, every element appears twice except for one. Find that single one. Example Solution…

Problem Statement Given an array, rotate the array to the right by k steps, where k is non-negative. Example Solution (Simple) Its like…

A Binary tree is a data structure which has two children nodes attached to it, called left and right node. Do remember, its different from a…