Telegram Web Link
Mathsey
+======+
Given a square matrix, calculate the absolute difference between the sums of its diagonals.

For example, the square matrix is shown below:

1 2 3
4 5 6
9 8 9
The left-to-right diagonal = . The right to left diagonal = . Their absolute difference is .

Function description

Complete the function in the editor below.

diagonalDifference takes the following parameter:

int arr[n][m]: an array of integers
Return

int: the absolute diagonal difference
Input Format

The first line contains a single integer, , the number of rows and columns in the square matrix .
Each of the next lines describes a row, , and consists of space-separated integers .

Constraints

Output Format

Return the absolute difference between the sums of the matrix's two diagonals as a single integer.

Sample Input

3
11 2 4
4 5 6
10 8 -12
Sample Output

15
Explanation

The primary diagonal is:

11
5
-12
Sum across the primary diagonal: 11 + 5 - 12 = 4

The secondary diagonal is:

4
5
10
Sum across the secondary diagonal: 4 + 5 + 10 = 19
Difference: |4 - 19| = 15

Note: |x| is the absolute value of x
+======+
Thank you to star prince for this challenge!
CRYPTOGRAPHY
+=======+
Difficulty: Medium
Time: 20 min
Language: Any
+=======+

Given a string, create a function that encrypts the string so that it is not human readable. After that, create a decryption algorithm that returns the initial string.

eg:
- encrypt("Hello world!") -> "aahude&38"
- decrypt("aahude%38") -> "Hello world!"

There will be a secret price for the person that submits the coolest algorithm

+=======+
Thanks to calle978 for this suggestion!
Hannoying
+=======+
There are three towers. The objective of the game is to move all the disks over to tower #3, but you can't place a larger disk onto a smaller disk. To play the game or learn more about the Tower of Hanoi, read https://en.wikipedia.org/wiki/Tower_of_Hanoi

Create a function that takes a number discs as an argument and returns the minimum amount of steps needed to complete the game.

towerHanoi(3) ➞ 7
towerHanoi(5) ➞ 31
towerHanoi(0) ➞ 0


Notes:
- The amount of discs is always a positive integer.
- 1 disc can be changed per move.

+=========+
Post your solution to https://prograchallenges.com/challenge/hannoying!
Got a challenge Idea? DM it to @BinaryByter for a chance to be featured on this channel!
Help!
+=======+
function swap(a, b) {
b = a
a = b
return [a, b]
}


This function does not do what it should. Here are a few test cases as examples

swap(100, 200) ➞ [200, 100]
swap(44, 33) ➞ [33, 44]
swap(21, 12) ➞ [12, 21]


Can you help fix this code?
+=========+
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!
Focus!
+=====+
We all need a bit of help! We have experienced many people asking questions, which is an amazing thing! For this, we have created a group. In order to keep quality, the group will be very strictly moderated - meaning that every question and answer is going to be gold!

Join the group at @programming_questions

+=====+
How are you doing? Tell us in the chit-chat-group connected to this channel!
Sums
+===+
Time: 10 Minutes
Difficulty: Easy
+=======================+
Given an Integer n, show all possible sums of integers that result in n. For instance, if n = 10 then the output should be

1+9 2+8 3+7
4+6 4+5+1 4+3+2+1

+==========+
Thanks to Vishal for inspiring this challenge! 💚
Got a challenge Idea? DM it to @BinaryByter for a chance to be featured on this channel!
There has been a huge increase in Subscribers to this channel today: Im super interested: Where are you all coming from? How did you find this channel?

Edit: To join our group, please follow this link: https://www.tg-me.com/joinchat-LWKPjeMMmpUyNTky
That's DS!
+=============+
Time: 1 Hour
Difficulty: easy
+=============+
Implement a queue that can be used for any datatype.

+=========+
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 promise!
+========+
Promises are just objects that contain the outcome of asynchronous operations. So when do you use one? When you want to control the outcome of an asynchronous operation. All you have to do is wrap the asynchronous function with a promise constructor.

The promise constructor requires you to pass a function called the executor which takes two parameters, resolve and reject. Both are functions that you use to pass or reject a value that is usually the result of the async operation. Here's an example of a simple promise:

let promise = new Promise( (resolve, reject) => {
setTimeout(( ) => {
resolve("prograchallenges")
}, 1000)
})


setTimeout is a browser API that is very commonly used in tutorials to represent async operations. After 1000ms has passed, we call the callback function in setTimeout() and pass a string "prograchallenges" to the resolve function.

Create a simple promise and pass the resolve function a string value of your choice. Use the setTimeout function as your asynchronous operation. Your setTimeout() function should not exceed 1000ms. Store the promise inside a variable named promise.
+=========+
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!
Forwarded from Programming jobs
How many linkedin connections do you have?
Anonymous Poll
52%
0-50
12%
51-100
8%
100-200
7%
200-400
21%
400+
Collision Detection
==============
In order to see wether two objects collide together without slowing down the game, game developers came up with many tricks. Can you find one of them?
Make an algo that detects collision and runs fast even with 1000 objects!
+=========+
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!
B G O O O R S T
+============+

Implement three sorting algorhythms!
Compare them in speed and Ram usage! Then, implement Bogosort. Make all four algorhyrhms compete. What do you notice?
Forwarded from AI Programming
10, If you want to iterate over the values in an array of integers called arrNumbers to perform an action on them, which loop statement enables you to do this
Anonymous Quiz
18%
for each (int number in arrNumbers){ }
38%
for (int i; each i in arrNumbers; i++){ }
20%
foreach (number in arrNumbers){ }
24%
foreach (int number in arrNumbers){ }
true randomness
+=============+
Difficulty: medium
Time: 1h
Languages: Javascript
+================+
Make a random numbers generator that bases on the current internet speed.

Since the internet speed is very unsteady, its perfect to make a RNG.
+=========+
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!
DRY (don't repeat yourself) is...

Please explain your choice in the group :)
Anonymous Poll
71%
Good
8%
Harmful
12%
Waste of time
8%
Other
Programming Challenges pinned «Focus! +=====+ We all need a bit of help! We have experienced many people asking questions, which is an amazing thing! For this, we have created a group. In order to keep quality, the group will be very strictly moderated - meaning that every question and…»
BURGERS (or was it Burglars?)
+=======================+
Given three arguments ⁠— an object obj of the stolen items, the pets name and a value ⁠— return an object with that name and value in it (as key-value pairs).

addName({}, "Brutus", 300) ➞ { Brutus: 300 }

addName({ piano: 500 }, "Brutus", 400) ➞ { piano: 500, Brutus: 400 }

addName({ piano: 500, stereo: 300 }, "Caligula", 440) ➞ { piano: 500, stereo: 300, Caligula: 440 }


The value argument will be a number.+=========+
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!
Pip e
+====+
What is the length of the shortest pipe, of internal radius 50mm, that can fully contain 21 balls of radii 30mm, 31mm, ..., 50mm?

Give your answer in micrometres (10-6 m) rounded to the nearest integer.
+===+
Thank you to Rishabh for suggesting this challenge! 🤩
2025/07/07 13:17:20
Back to Top
HTML Embed Code: