Telegram Web Link
LAND IN SIGHT
+===========+
The function is given a map with 1 representing land, 0 representing water. A land cell can have four neighbors along its edges. Compute the total perimeter of shore-lines that are defined by land cells touching water or the outer edges of the map. Each cell edge has a length equal to 1. An isolated cell without neighbors has a total perimeter length of 4.
Examples

islandsPerimeter([
[0, 1, 0, 0],
[1, 1, 1, 0],
[0, 1, 0, 0],
[1, 1, 0, 0]
]) ➞ 16

islandsPerimeter([
[1, 1, 1, 1, 1, 1],
[1, 0, 0, 0, 0, 1],
[1, 0, 1, 1, 0, 1],
[1, 0, 0, 0, 0, 1],
[1, 1, 1, 1, 1, 1],
]), 42)

islandsPerimeter([
[1, 0]
]) ➞ 4

+=========+
Please answer to this message with your solution :)
Got a challenge Idea? DM it to @BinaryByter for a chance to be featured on this channel!
VOWEL
+====+
Write a function that takes in a string and for each character, returns the distance to the nearest vowel in the string. If the character is a vowel itself, return 0.
Examples

distanceToNearestVowel("aaaaa") ➞ [0, 0, 0, 0, 0]

distanceToNearestVowel("babbb") ➞ [1, 0, 1, 2, 3]

distanceToNearestVowel("abcdabcd") ➞ [0, 1, 2, 1, 0, 1, 2, 3]

distanceToNearestVowel("shopper") ➞ [2, 1, 0, 1, 1, 0, 1]

All input strings will contain at least one vowel.
Strings will be lowercased.
Vowels are: a, e, i, o, u.

+=========+
Please answer to this message with your solution :)
Got a challenge Idea? DM it to @BinaryByter for a chance to be featured on this channel!
!function (a) { console.log('hi' + a)}(' world')
Anonymous Quiz
40%
"hi world"
19%
No output
19%
Warning: Stray ! in code
22%
Error: Stray ! in code
Preparing for a coding interview? Join Algochallenges. One algorithm question every day with an explanation
Forwarded from Algochallenges
How many children does a binary tree have?
Anonymous Quiz
44%
2
24%
0 or 1 or 2
23%
Any number of children
9%
0 or 1
Langtons Ant
+=========+

Using P5.JS (or any other language), Implement a cellular automaton according to those rules:
https://en.wikipedia.org/wiki/Langton%27s_ant

+==========+
@prograchallenges

Please answer to this post with your solution! :)
GCF
+=====+
The greatest common factor of a set of numbers is the largest number that all numbers can be divided by without a reminder, for example, the greatest common factor of 21, 49, and 35 is 7 because they all can be divided by 7 without a reminder.
Challenge:
Write a function that takes any number of arguments and returns the greatest common factor.
+=========+
Thank you to @ayoob2 for submitting this question -
Please answer to this message with your solution :)
Got a challenge Idea? DM it to @BinaryByter for a chance to be featured on this channel!
FLIPPIDIBIT
+========+
Given a string of any length, implement a function that flips the characters of the strings - reduce the amount of inbuilt functions used

+=========+
Please answer to this message with your solution :)
Got a challenge Idea? DM it to @BinaryByter for a chance to be featured on this channel!
RETURN TO SENDER!
+===============+

A boomerang is a V-shaped sequence that is either upright or upside down. Specifically, a boomerang can be defined as: sub-array of length 3, with the first and last digits being the same and the middle digit being different.

[3, 7, 3], [1, -1, 1], [5, 6, 5]

***Create a function that returns the total number of boomerangs in an array.***

[3, 7, 3, 2, 1, 5, 1, 2, 2, -2, 2]
// 3 boomerangs in this sequence: [3, 7, 3], [1, 5, 1], [2, -2, 2]


countBoomerangs([9, 5, 9, 5, 1, 1, 1]) ➞ 2

countBoomerangs([5, 6, 6, 7, 6, 3, 9]) ➞ 1

countBoomerangs([4, 4, 4, 9, 9, 9, 9]) ➞ 0

Notes

[5, 5, 5] (triple identical digits) is NOT considered a boomerang because the middle digit is identical to the first and last.


+=========+
Please answer to this message with your solution :)
Got a challenge Idea? DM it to @BinaryByter for a chance to be featured on this channel!
Data Structures #1
+===========+
Language: any
Time: 3hours
Difficulty: easy
+===========+
Implement a linked list and a pair of iterators for it.
+=========+
Please answer to this message with your solution :)
Got a challenge Idea? DM it to @BinaryByter for a chance to be featured on this channel!
Advent of code #1
+=============+
You're minding your own business on a ship at sea when the overboard alarm goes off! You rush to see if you can help. Apparently, one of the Elves tripped and accidentally sent the sleigh keys flying into the ocean!

Before you know it, you're inside a submarine the Elves keep ready for situations like this. It's covered in Christmas lights (because of course it is), and it even has an experimental antenna that should be able to track the keys if you can boost its signal strength high enough; there's a little meter that indicates the antenna's signal strength by displaying 0-50 stars.

Your instincts tell you that in order to save Christmas, you'll need to get all fifty stars by December 25th.

Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants one star. Good luck!

As the submarine drops below the surface of the ocean, it automatically performs a sonar sweep of the nearby sea floor. On a small screen, the sonar sweep report (your puzzle input) appears: each line is a measurement of the sea floor depth as the sweep looks further and further away from the submarine.

For example, suppose you had the following report:

199
200
208
210
200
207
240
269
260
263


This report indicates that, scanning outward from the submarine, the sonar sweep found depths of 199, 200, 208, 210, and so on.

The first order of business is to figure out how quickly the depth increases, just so you know what you're dealing with - you never know if the keys will get carried into deeper water by an ocean current or a fish or something.

To do this, count the number of times a depth measurement increases from the previous measurement. (There is no measurement before the first measurement.) In the example above, the changes are as follows:

199 (N/A - no previous measurement)
200 (increased)
208 (increased)
210 (increased)
200 (decreased)
207 (increased)
240 (increased)
269 (increased)
260 (decreased)
263 (increased)


In this example, there are 7 measurements that are larger than the previous measurement.

How many measurements are larger than the previous measurement?
+========+
https://adventofcode.com/2021/day/1
+=========+
Please answer to this message with your solution :)
Got a challenge Idea? DM it to @BinaryByter for a chance to be featured on this channel!
I just figured out how to create an advent of code leaderboard ( You can call me some sort of genius 😉 )

Join it using this code: 1730310-696745cd
Forwarded from CrazyOne
FREE BOOKS
+==========+
Download programming books for FREE, all books from 2019!

https://www.tg-me.com/progerbooks
Thicc Water!
+=========+
Implement a function that takes height and radius of a cylinder!
The output should be the weight of a column of water of those proportions.
For an additional challenge, round the result to exactly 2 decimals.
+=========+
Please answer to this message with your solution :)
Got a challenge Idea? DM it to @BinaryByter for a chance to be featured on this channel!
if (isset($_GET['num'])) {
if (is_numeric($_GET['num'])){
if (strlen($_GET['num']) < 7){
if ($_GET['num'] > 999999)
echo "this is a bug";
}
}
}


What number can replace with num that print echo?
Your help for prograchallenges.com
+===========================+
In order to build an amazing website for you, we need to understand your needs! Please support our open source project to strengthen to community by answering this simple, anonymous, fun and quick survey: https://surveyheart.com/form/61b07c591ca6e536ec4d2601
ARDUINONONONOOOOOO!
+======================+
Build a program that records the highest temperature since the program started and the highest temp in the last 10 minutes. Record the lowest temp since power up as well as lowest in ten minutes. These are saved in an array of ints where the last two significant digits are decimal points. (I.e. 123.45 is stored as 12345; 1.2345 is saved as 123)

+======================+
Please answer to this message with your solution :)
Got a challenge Idea? DM it to @BinaryByter for a chance to be featured on this channel!
Texting
+=====+
Given the string "A string." Print on one line the letter on the index 0 and the pointer position. Increase the pointer by two. Rinse and repeat until the string is over.

Alternatively: Replace pointers by Iterators

+=======+

Got a challenge Idea? DM it to @BinaryByter for a chance to be featured on this channel!
SPEED
+====+
If the lowest speed of a car was written as (50) instead of zero and the highest speed (250) instead of (200) then how can we know what speed we are at if the speedometer reads, for example, 100?
_________
Write a program that takes two arrays of length 2 each, and a number to be converted based on the inputted arrays. The first array is like the scale, the second array is what should be converted based on the first array, and the third argument is the number to be converted.

example:
function([1,100], [50,150], 60) //output => 10

function([1,100], [50,150], 80) //output => 30
2025/07/07 09:01:26
Back to Top
HTML Embed Code: