There are n pencils, each having l length. Each can write 4 kilometers. After writing 4 kilometers it has l/4 length. One can join 4 pencils which are having l/4 length and Read more →
Algorithms
6 postsGiven a number X, and an array of length N containing the N numbers. Find the minimum number of operations required to make X non-positive. In one operation, you can select any Read more →
Given a ‘N*N’ 2d matrix consisting of positive integers, the task is to find the probability of collecting maximum points by moving either up(from {i,j} to {i+1,j}) or right (from {i,j} to Read more →
Imagine a rooted tree ( with root as node 1). Every node is given two values, init value and expected value. Our task is to flip the node value to make the Read more →
Given a number N which is a power of 2. Calculate total number of set bits from 1 to N-1. Examples : Input : N = 8 Output : 12 Explanation : Read more →
The Math.truncate() function used to return the rounded value of the specified double and float value. Syntax: fun truncate(x : DataType): DataType Parameters: It can take data two data type such as Read more →
An important aspect of competitive coding is analyzing the algorithms because in competitive coding apart from correctness, efficiency of algorithms also matters significantly. One the most important aspect of time complexity analysis Read more →
Given an integer array a[] of size N and a target sum K, subtract a number from each element such that each element becomes X ( if an element is less than Read more →
Given a number N, the task is to find Nth icosikaienneagonal number. An icosikaienneagonal number is class of figurate number. It has 29 – sided polygon called icosikaienneagon. The N-th icosikaienneagonal number Read more →
Leetcode Hard Problem, Simplest Solution Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity should Read more →