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


[Solved] Oracle Linux 10 WiFi adpator not found

8 Jul 2025 1 minute read 0 comments Lochard

This is a solved problem, but I think it might help other newbies like me. It might also work on other Linux distros with the same problem. You can read here or read my post on Oracle Forums. I can't provide much technical information as I lack the k...

Codewars Kata — Sum of two lowest positive integers

19 Aug 2023 1 minute read 0 comments Lochard

Create a function that returns the sum of the two lowest positive numbers given an array of minimum 4 positive integers. No floats or non-positive integers will be passed.   For example, when an array is passed like [19, 5, 42, 2, 77], the output sho...

Please check the password! @ Dcoder

17 Aug 2023 1 minute read 0 comments Lochard

Problem: Ethan has a possible list of password to hack a secure account. To select the correct password, he researched the owner and discovered that the account's owner is very fond of acronyms. After eliminating the rest of the patterns, Ethan is no...

Binary Operations @ Dcoder

16 Aug 2023 1 minute read 0 comments Lochard

Problem: You will be given two numbers, a and b, in their binary form. You need to print their sum and their product in binary. Input: Two strings separated by space representing the binary values of a and b. Output: Print their sum(a+b) in the first...

Power Number @ Dcoder

15 Aug 2023 1 minute read 0 comments Lochard

Problem: A Power Number is a positive number that can be expressed as x^x, i.e. x raise to the power of x, where x is any positive number. You will be given an integer array A and you need to print if the elements of array A are Power Numbers or not....

Power Number @ Dcoder

13 Aug 2023 1 minute read 0 comments Lochard

Problem: A Power Number is a positive number that can be expressed as x^x, i.e. x raise to the power of x, where x is any positive number. You will be given an integer array A and you need to print if the elements of array A are Power Numbers or not....

Codewars Kata - Testing 1-2-3

12 Aug 2023 1 minute read 0 comments Lochard

DESCRIPTION: Your team is writing a fancy new text editor and you've been tasked with implementing the line numbering.   Write a function which takes a list of strings and returns each line prepended by the correct number.   The numbering starts at 1...

Cody's Team @ Dcoder

10 Aug 2023 1 minute read 0 comments Lochard

Problem: Cody is preparing for a programming competition. He needs k more members for his team to be eligible for the competition. So he organizes a coding test for all his juniors to select the best group. His teacher has instructed him to only sele...

Arithmetic Sequence @ Dcoder

9 Aug 2023 1 minute read 0 comments Lochard

Problem: In mathematics, an arithmetic progression (AP) or arithmetic sequence is a sequence of numbers such that the difference between the consecutive terms is constant. John was writing an Arithmetic sequence with N terms, but while writing he mis...

If you can't sleep, just count sheep!!

8 Aug 2023 1 minute read 0 comments Lochard

DESCRIPTION: If you can't sleep, just count sheep!!   Task: Given a non-negative integer, 3 for example, return a string with a murmur: "1 sheep...2 sheep...3 sheep...". Input will always be valid, i.e. no negative integers. def count_sheep( n ):...