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

Using loops to draw patterns(Pyramid) @ Dcoder

Problem: Draw the pattern specified using loops. Input:  Output: The pattern as shown in sample output. First line contain 4 space and 1 star, next line contains 3 space and 3 stars and so on.. Constraints: Try not to hardcode the output. Sample Inpu...

Lochard 1 minute read 8 Jul 2023 0 comments $0.00

They see me Palindroming @ Dcoder

Problem: In india there is a puzzle"5 characters my name, reverse- forward is the same." You will be presented with a 5 character String, you have to tell whether it satisfy above puzzle, if yes output "Yes" else "No" Input: Input is String S of 5 ch...

Lochard 1 minute read 7 Jul 2023 0 comments $0.02

Toggle Me! @ Dcoder

Problem: Cody is very irritating child. He always change the characters in his homework, he has a trick. He change all small letter to capital and viceversa. His frinds gave him the title "The Toggle dude".One day his friends gave him some words, but...

Lochard 1 minute read 6 Jul 2023 0 comments $0.04

The irritating Students @ Dcoder

Problem: Cody is Professor at Zing University. He teaches English there. During his first class, he found the students are very talkative. So,he decided to divide the class into two sections, A & B such that the difference between the strength of two...

Lochard 1 minute read 5 Jul 2023 0 comments $0.01

Reverse me @ Dcoder

Problem: You are given an integer, reverse it. Input: Input contains an integer n. Output: Print reverse of integer. Constraints: 1≤n≤10000 Sample Input: 9956 Sample Output:  6599 print(input()[::-1].lstrip('0'))

Lochard 1 minute read 4 Jul 2023 0 comments $0.00

The Predictor @ Dcoder

Problem: Cody always wanted to have some psychic powers so that he could showoff his skills, and magic to people and impress them, specially his girlfriend.But, in spite all his efforts, hardwork, dedication, Googling, watching youtube videos he coul...

Lochard 1 minute read 3 Jul 2023 0 comments $0.01

I don't like Repetition @ Dcoder

Problem: The problem is simple, you are given a word. You need to remove the repeating characters. Input: Input contains a word w. Output: Print the output according to the problem explained. Constraints: 1≤w length≤100 Sample Input: AaabBbbc Sample...

Lochard 1 minute read 2 Jul 2023 0 comments $0.00

Let's get GCD @ Dcoder

Problem: Cody was doing his maths homework, suddenly he found a GCD(Greatest Comman divisor) problem. He is very lazy to do all the calculations for this exercise, so he just took his mobile and opened the Dcoder App, decided to code a program to fin...

Lochard 1 minute read 1 Jul 2023 0 comments $0.01

The closest to Average @ Dcoder

Problem: You are given an array, you have to find the closest integer to its average, look it has to be closest,not just the truncated version of the average. Input: First line contains n , number of elements of array, next line contains n integer se...

Lochard 1 minute read 30 Jun 2023 0 comments $0.01

The Vowel Counter @ Dcoder

Problem: You are given with a String, you have to output count of vowels in the String. Input: Input contains a String. Output: Print vowel count in the String. Constraints: 1≤String lenght≤1000 Sample Input: Dcoder,A mobile coding platform Sample Ou...

Lochard 1 minute read 29 Jun 2023 0 comments $0.00