Programming

618 Articles 12 Followers


Word Frequency @Dcoder

4 Aug 2023 1 minute read 0 comments Lochard $0.01

Title: Word Frequency Problem: You will be given a group of words. You need to print all unique words in that group in descending order of their frequency, i.e the word repeated most number of times will come first. In case of two words having the sa...

Simple multiple problem @ Dcoder

3 Aug 2023 1 minute read 0 comments Lochard $0.07

Problem: You are given 2 numbers N and M. You have to find the smallest number which when multiplied to N makes it a multiple of M.   Input: First line contains T, number of test cases. Each of the next T lines contains two numbers, N and M. Output:...

Leetcode - 1089. Duplicate Zeros

1 Aug 2023 1 minute read 1 comment Lochard $0.01

Given a fixed-length integer array arr, duplicate each occurrence of zero, shifting the remaining elements to the right.   Note that elements beyond the length of the original array are not written. Do the above modifications to the input array in pl...

Symmetric Matrix @ Dcoder

1 Aug 2023 1 minute read 0 comments Lochard $0.02

Problem: Given a matrix of dimensions N x N. Print "YES"(without quotes) if it is a symmetric matrix, else print "NO"(without quotes).   Input: First line contains N. Each of following N lines contains N integers each, denoting the matrix.   Output:...

Wrestling Championship @ Dcoder

31 Jul 2023 1 minute read 0 comments Lochard $0.02

Problem: Hulk is participating in a wrestling championship. The contest consists of N fighters including Hulk. The contest is of several stages. At each stage, if number of fighters are X, then there are X/2 fights and X/2 fighters move on to the nex...

Codewars Kata - How good are you really?

30 Jul 2023 1 minute read 0 comments Lochard $0.07

DESCRIPTION: There was a test in your class and you passed it. Congratulations! But you're an ambitious person. You want to know if you're better than the average student in your class.   You receive an array with your peers' test scores. Now calcula...

Codewars 7 kyu Kata - Mumbling

29 Jul 2023 1 minute read 0 comments Lochard $0.02

DESCRIPTION: This time no story, no theory. The examples below show you how to write function accum:   Examples: accum("abcd") -> "A-Bb-Ccc-Dddd" accum("RqaEzty") -> "R-Qq-Aaa-Eeee-Zzzzz-Tttttt-Yyyyyyy" accum("cwAt") -> "C-Ww-Aaa-Tttt" The paramete...

Codewars 6 kyu Kata - Multiples of 3 or 5

28 Jul 2023 1 minute read 0 comments Lochard $0.02

DESCRIPTION: If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.   Finish the solution so that it returns the sum of all the multiples of 3 or 5 below the number passed in....

Excelencia's TheComparisonStatsSeries 22 : one year ago(2022) and yesterday Sunday, July 23 2023.

24 Jul 2023 1 minute read 0 comments excelencia $0.08

Yesterday one year ago(2022) it was a saturday...  and also  day 108 of Excelencia's TheDailyStatsSeries...        and yesterday, also July 23  but in this year 2023 ,it was Sunday...and also day 22 of Excelencia's TheComparisonStatsSeries...  Sund...

Learning Factorials with Loop/Recursion @ Dcoder

24 Jul 2023 1 minute read 0 comments Lochard $0.14

Problem: If n is an integer greater than 0, n factorial (n!) is the product: n* (n-1) * (n-2) * ( n-3)… * By convention, 0! = 1. Write a Program to compute n Factorial(n!), where n is input.  Input: n is a positive integer Output: Output will be n fa...