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

String Matching @ Dcoder

Problem: Cody has a sequence of characters N. He likes a sequence if it contains his favourite sequence as a substring. Given the sequence and his favourite sequence F, check whether the favourite sequence is present in the sequence. Input: The first...

Lochard 1 minute read 10 Mar 2023 2 comments $0.03

SwapMaster solves Symmetric Swap @ Dcoder

roblem: The SwapMaster is known to be the greatest and fastest swapper of all time. You intend to bring him down and become the new SwapMaster of the city. Through some secret sources, you found out that The SwapMaster undertook yet another task from...

Lochard 1 minute read 7 Mar 2023 0 comments $0.01

Floating Number @ Dcoder

Problem: Bob has a floating point number N. He wants to set the precision for 2 digits after the decimal point for the number.He is not good at coding, hence looking for your help.Input: The first line contains T, the number of test cases.Next T line...

Lochard 1 minute read 4 Mar 2023 2 comments $0.07

Rotate Array @ Dcoder

Problem: You are given an array of N length. You have to rotate the array rightwards by K rotations, that is, shift each element to the right by K positions. Print the rotated array. Input: First line contains N and K. Second line contains N integers...

Lochard 1 minute read 2 Mar 2023 0 comments $0.05

Double the Number @ Dcoder

Problem: Given an array A of size N and K. count all the number of elements such that A[i] * 2 = K. Input: The first line of the input contains a single integer T denoting the number of test cases. The first line of each test case contains two space...

Lochard 1 minute read 15 Feb 2023 0 comments $0.02

Bitwise for Dummies @ Dcoder

Problem: This is to provide you with an introductory experience of bit-wise operations. There are basically six bit-wise operations in any programming language : - AND(&), OR(|), XOR(^), NOT(~), left-shift operator(). You will be given 2 numbers a an...

Lochard 1 minute read 13 Feb 2023 0 comments $0.01

Advent of Code 2022 Day 3

Sorry that I am blogging via my phone and I don't want to type too much. I will just share the finished code. You can see all of them on GitHub. --- Advent of Code 2022 Day 3 **Part 1** inputs

Lochard 1 minute read 27 Jan 2023 0 comments $0.02

Advent of Code 2022 Day 2

Sorry that I am blogging via my phone and I don't want to type too much. I will just share the finished code. You can see all of them on [GitHub](https://github.com/locharp/code-snippets/tree/main/AdventOfCode). --- Advent of Code 2022 Day 2 **Part 1...

Lochard 1 minute read 25 Jan 2023 0 comments $0.01

Advent of Code 2022 Day 1

Sorry that I am blogging via my phone and I don't want to type too much. I will just share the finished code. You can see all of them on GitHub. Advent of Code 2022 Day 1 **Part 1** inputs

Lochard 1 minute read 24 Jan 2023 0 comments $0.07

C Kata - Are you playing banjo?

Learning from YayoDrayber, I am sharing my CodeWars DESCRIPTION:Create a function which answers the question "Are you playing banjo?".If your name starts with the letter "R" or lower case "r", you are playing banjo! The function takes a name as its o...

Lochard 1 minute read 11 Jan 2023 0 comments $0.04