hadivarp / myChallenge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

My Code Challenge

Welcome to my code challenge repository! Here, I've taken on the task of solving programming problems that have caught my interest. The solutions are implemented in languages I am familiar with, or at least those I believe I understand. These questions are distinct from those found on platforms like Euler Project or LeetCode; instead, they are sourced from various places, often discovered through sources like Jadi's videos.

Question Sources and Difficulty Tags

  • Dizzy Problem Medium

    The first set of questions comes from Jadi's videos. As Jadi's repository is not regularly updated, I've chosen to save and maintain them here.

  • MayDay Problem
    Medium

    The second question, known as the MayDay Problem, is sourced from Jadi's videos. It adds an intriguing twist to the problem-solving journey.

  • Generate Three-Digit Numbers Medium

    The third question involves generating three-digit numbers using only 2 different digits taken from 1 to 9. The challenge is to explore the possibilities of creating these numbers, even allowing repetition of digits. This question can be found in Jadi's videos.

  • Three Number Sum
    Medium

    The fourth question, "Three Number Sum," focuses on finding all triplets in an array that sum up to a target sum. The numbers in each triplet should be ordered in ascending order, and the triplets themselves should be ordered in ascending order with respect to the numbers they hold.

  • Monotonic Array Medium

    The fifth question, "Monotonic Array," requires writing a function that takes in an array of integers and returns a boolean representing whether the array is monotonic. An array is said to be monotonic if its elements, from left to right, are entirely non-increasing or entirely non-decreasing. Non-increasing elements aren't necessarily exclusively decreasing; they simply don't increase. Similarly, non-decreasing elements aren't necessarily exclusively increasing; they simply don't decrease. Note that empty arrays and arrays of one element are monotonic.

  • Move Element To End
    Easy

    The sixth question, "Move Element To End," requires writing a function that moves all instances of a given integer in the array to the end of the array and returns the array. The function should perform this in place (i.e., it should mutate the input array) and doesn't need to maintain the order of the other integers. Check out the details here.

  • Valid BST Easy

    The seventh question focuses on validating a Binary Search Tree (BST). Each node in the BST has an integer value, a left child node, and a right child node. To be considered a valid BST node, the node must satisfy the BST property: its value should be strictly greater than the values of every node to its left, less than or equal to the values of every node to its right, and its children nodes should either be valid BST nodes themselves or None/null. This problem provides an opportunity to implement a function to check whether a given binary tree adheres to the specified conditions, making it a suitable challenge for those at an easy difficulty level.

  • Min Number of Coins for Change Medium

    The eighth question, "Min Number of Coins for Change," addresses the challenge of finding the smallest number of coins needed to make change for a target amount using given coin denominations. Given an array of positive integers representing coin denominations and a single non-negative integer n representing a target amount of money, the task is to write a function that returns the smallest number of coins needed. Note that you have access to an unlimited amount of coins. In other words, if the denominations are [1, 5, 10], you have access to an unlimited amount of 1s, 5s, and 10s. The source and solution for this question can be found here.

  • Guessing Number Easy

    The ninth question, "Guessing Number," involves creating a game where the player has up to 10 chances to guess a randomly generated number between 1 and 100. The player is informed whether their guess is too low or too high after each attempt. If the player guesses correctly within 10 attempts, they win. Otherwise, the game ends with a failure message.

  • Guessing Repeated Number Easy

    The tenth question, "Guessing Repeated Number," is a game where the program generates an array of 10 random numbers between 1 and 9. The player is shown these numbers for 5 seconds, then the screen is cleared. A random number from 1 to 9 is selected, and the player must guess how many times that number appears in the array. The game tests the player's memory and counting skills in a fun, interactive way.

Feel free to explore the solutions, and I hope you find them as enjoyable as I did!

About


Languages

Language:Ruby 100.0%