×
Home
Jobs
Tools
Coding Ground
Current Affairs
UPSC Notes
Online Tutors
Whiteboard
Net Meeting
Tutorix
Login
Packages
Categories
Java
JSP
iOS
HTML
Android
Python
C Programming
C++ Programming
C#
PHP
CSS
Javascript
jQuery
SAP
SAP HANA
Data Structure
RDBMS
MySQL
Mathematics
8085 Microprocessor
Operating System
Digital Electronics
Analysis of Algorithms
Mobile Development
Front End
Web Development
Selenium
MongoDB
Computer Network
General Topics
Library
Videos
Q/A
eBooks
Login
Library
Videos
eBooks
Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Selected Reading
UPSC IAS Exams Notes
Developer's Best Practices
Questions and Answers
Effective Resume Writing
HR Interview Questions
Computer Glossary
Who is Who
AmitDiwan
has Published
8491
Answers
Unique substrings in circular string in JavaScript
Javascript
Web Development
Front End Technology
AmitDiwan
Published on 04-Mar-2021 10:50:05
ProblemSuppose we have a S, str. which is an infinite wraparound string of the string −"abcdefghijklmnopqrstuvwxyz".Therefore, S will look like this −"...zabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd....".We are required to write a JavaScript function that takes in str, let’s call that string str, as the only argument.Our function should find out how many unique non-empty ...
Read More
Deriving Random10() function from Random7() in JavaScript
Javascript
Web Development
Front End Technology
AmitDiwan
Published on 04-Mar-2021 10:48:40
Problemconst random7 = () => Math.ceil(Math.random() * 7);Suppose we have the above fat arrow function. This function yields a random number between 0 (exclusive) and 7 (inclusive) everytime we make a call to it.We are required to write a similar random10() JavaScript function that takes no argument and makes no ...
Read More
Checking for convex polygon in JavaScript
Javascript
Web Development
Front End Technology
AmitDiwan
Published on 04-Mar-2021 10:46:51
Convex PolygonA convex polygon is defined as a polygon with all its interior angles less than 180°.ProblemWe are required to write a JavaScript function that takes in an array of coordinates, basically the array will be an array of arrays each subarray containing exactly two numbers, specifying a point on a ...
Read More
Encoding string to reduce its size in JavaScript
Javascript
Web Development
Front End Technology
AmitDiwan
Published on 04-Mar-2021 10:43:25
ProblemWe are required to write a JavaScript function that takes in a string of characters, str, as the only argument. Our function should encode the input string and compare its size with the original string and return the string which is smaller in size.The rule to encode a particular string ...
Read More
Forming string using 0 and 1 in JavaScript
Javascript
Web Development
Front End Technology
AmitDiwan
Published on 04-Mar-2021 10:40:56
ProblemWe are required to write a JavaScript function that takes in an array of strings, arr, formed using 0 and 1 only as the first argument.The function takes two numbers as the second and third argument, m and respectively. The task of our function is to find how many strings ...
Read More
Finding median for every window in JavaScript
Javascript
Web Development
Front End Technology
AmitDiwan
Published on 04-Mar-2021 10:37:42
MedianMedian in mathematics, median is the middle value in an ordered(sorted) integer list.If the size of the list is even, and there is no middle value. Median is the mean (average) of the two middle values.ProblemWe are required to write a JavaScript function that takes in an array of Integers, ...
Read More
Magical String: LeetCode Question in JavaScript
Javascript
Web Development
Front End Technology
AmitDiwan
Published on 04-Mar-2021 10:34:25
ProblemA magical string str consists of only '1' and '2' and obeys the following rules −The string str is magical because concatenating the number of contiguous occurrences of characters '1' and '2' generates the string str itself.The first few elements of string str is the following −str = "1221121221221121122……"If we ...
Read More
Formatting Software License Key in JavaScript
Javascript
Web Development
Front End Technology
AmitDiwan
Published on 04-Mar-2021 10:32:50
ProblemWe are required to write a JavaScript function that takes in a string str, as the first argument and an Integer, n as the second argument. The string str is composed of alphanumeric characters and dashes.The dashes split the alphanumeric characters within the string into groups. (i.e. if there are ...
Read More
Finding the smallest good base in JavaScript
Javascript
Web Development
Front End Technology
AmitDiwan
Published on 04-Mar-2021 10:30:09
Good BaseFor an integer num, we call k (k >= 2) a good base of num, if all digits of num base k are 1.For instance: 13 base 3 is 111, hence 3 is a good base for num = 13ProblemWe are required to write a JavaScript function that takes ...
Read More
Consecutive ones with a twist in JavaScript
Javascript
Web Development
Front End Technology
AmitDiwan
Published on 04-Mar-2021 10:26:26
ProblemWe are required to write a JavaScript function that takes in a binary array (an array that consists of only 0 and 1), arr, as the only argument. Our function should find the maximum number of consecutive 1s in this array if we can flip at most one 0.For example, ...
Read More
1
2
3
4
5
6
7
...
850
Next
Advertisements
Print
Add Notes
Bookmark this page
Report Error
Suggestions
Save
Close
Dashboard
Logout