N Stars Functions in java
In this task, you have to print n stars * vertically and n horizontally. You are given functions to complete. Donot worry about the input and ouput of functions just print n vertical stars in vertical and  ...
Elevate Your Coding Skills
HomeProgramming Language
In this task, you have to print n stars * vertically and n horizontally. You are given functions to complete. Donot worry about the input and ouput of functions just print n vertical stars in vertical and  ...
You are given a root pointer to the root of binary tree. You have to print the right view of the tree from top to bottom. Note The right view of a tree is the set of nodes that are visible from the right side. You need to complete ...
Given the root of a binary tree, flatten the tree into a "linked list": The "linked list" should use the same Node class where the right child pointer points to the next node in the list and the left child pointer is always null. The "linked l ...
Given a number, you task is to reverse its digits. If the reversed number contains 0s in the beginning, you must remove them as well. Input Format Functional problem, Number is the input Output Format Output is a single line containing r ...
You are given a 0-indexed integer array nums and a target element target. A target index is an index i such that nums == target. print a list of the target indices of nums after sorting nums in non-decreasing order. If there are no target indi ...
Given an integer array of which both the first half and second half are sorted. The task is to merge two sorted halves of the array into a single sorted array. Note: The two halves can be of arbitrary sizes. Input Format line 1: contains an ...
Find the 2nd smallest element in an unsorted array. Input Input consists of the first line containing integer N followed by N natural numbers for the array. Constraints: 1 <= n <= 100001 <= value of natural number <= 10000000 ...
In MATLAB, there is a very useful function called "reshape", which can reshape a matrix into a new one with different size but keep its original data. You are given a matrix represented by a two-dimensional array (m*n), and two positive integers ...
There are N buildings in a row with different heights(H). You are viewing the buildings from the left and can see the roof of a building, if no building to the left of that building has height greater than equal to height of that building. You are a ...
A common problem in mathematics is to determine which quadrant a given point lies in. There are four quadrants, numbered from 1 to 4, as shown in the diagram below: For example, the point A, which is at coordinates (12,5) lies in quadrant 1 s ...