As a newbie programmer
As a newbie programmer

As a newbie programmer

Sharing entry level codes. My snippets on GitHub https://github.com/locharp/code-snippets

Find me the divisor count @ Dcoder

Problem: Cody was solving a programming puzzle in Dcoder, and as always he is unable to do it alone. Puzzle statement is You are given three integers l,h,d and you have to find that how many integers between l and h (inclusive) are divisible by d.Let...

Lochard 1 minute read 27 Jun 2023 0 comments $0.08

Square of squares @ Dcoder

Problem: You have a hobby of building blocks. You are especially fond of building blocks that are squares. And what you even like more, is to arrange them into a square of square building blocks! /n However, sometimes, you are unable to achieve this...

Lochard 1 minute read 26 Jun 2023 0 comments $0.01

Capitalize me @ Dcoder

Problem: You will be given a string, all you have to do is capitalize first letter of each word in the given string. Input: Input contains a string s. Output: Print the manipulated string according to the problem described. Constraints: 1≤s length≤10...

Lochard 1 minute read 25 Jun 2023 0 comments $0.00

I'll be the next @ Dcoder

Problem: You are given a string, you have to convert each letter in the string with the next one.For example a becomes b and C becomes D. Input: Input contains a string s. Output: Print the manipulated string according to the problem. Constraints: 1≤...

Lochard 1 minute read 24 Jun 2023 0 comments $0.01

The Report Card! @ Dcoder

Problem: Priyanka is Professor at Zing University. Help the professor in assigning grades to her students.   The mean score of three subjects is to graded into 'A', 'B', 'C' or 'D' or 'F' depending upon the marks scored.   For the score >90 and score...

Lochard 1 minute read 23 Jun 2023 0 comments $0.01

The Secure function : Xr @ Dcoder

Title: The Secure function : Xr Problem: Cody is learning cryptography and security.The security book starts with a mathematics based problem. Say set X is collection of elements, for example X = {1,2,3} . Given 2 sets X and Y, We define a function f...

Lochard 1 minute read 4 Jun 2023 0 comments $0.02

The bit flipper @ Dcoder

Problem: You are given a binary number, you just need to flip each and every bit of it ie. 1 turns to 0 and 0 turns to 1. Input: Input contains a binary number. Output: Print the flipped binary number. Constraints: The binary number can be any binary...

Lochard 1 minute read 2 Jun 2023 0 comments $0.00

Exponentia! @ Dcoder

Problem: Create a code that allows people to learn about exponents. The task is to write a code which takes an integer number as an input and returns the values ranging from that of 2(two) raised to power 0(zero) to 2(two) raised to power n(the numbe...

Lochard 1 minute read 1 Jun 2023 0 comments $0.03

Binary to Decimal @ Dcoder

Problem: Write a code which converts a binary number (written as string) into a decimal number. Input: Input is a binary number. Output: The output is a decimal number.(interger value) Constraints: The binary number is non-negative and the resultant...

Lochard 1 minute read 31 May 2023 0 comments $0.00

First Half!! @ Dcoder

Problem: Given a string return its first half.Assume string to have even number of characters. Input: Input contains a string Output: Print the first half of string. Constraints: 0≤string length≤100 Sample Input: Dcoder Sample Output:  Dco s = input(...

Lochard 1 minute read 28 May 2023 0 comments $0.00