Urgent.News

What's breaking now, across thousands of outlets.

Tech

Weekly Challenge: An average reflection

Weekly Challenge 397 Each week Mohammad S. Anwar sends out The Weekly Challenge , a chance for all of us to come up with solutions to two weekly tasks. My solutions are written in Python first, and then converted to Perl. Unless otherwise stated, Copilot (and other AI tools) have NOT been used to generate the solution. It's a great way for us all to practice some coding. Challenge , My solutions…

Weekly Challenge 397 presents two coding tasks. The first task, Absent Smallest Positive, requires finding the smallest positive integer that is absent from a given array and greater than the average of all elements in the array. The solution involves calculating the average, initializing a variable with a value slightly above the average, and incrementing until an absent integer is found.

In the second task, Binary Reflection, an array of integers must be sorted based on the binary reflection of each element. The binary reflection is created by converting the integer to binary, reversing the binary string, and converting it back to an integer. The array is sorted first by numerical order for elements with the same binary reflection, then by their binary reflection values.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Binance Says 90% of Stolen Assets Replenished as Withdrawals Face Next Test

Binance’s announcement that it has replenished 90% of the assets lost in a major hack brings customer withdrawals into sharper focus. Setting aside enough money to absorb a loss is one step.

  • Binance replenished 90% of $6.34B stolen assets from October 30 hack
  • Withdrawals face next test due to liquidity and security concerns
  • $3B frozen assets to prevent further loss, investigation ongoing

A Screenshot MAE Is Not a Material Accuracy Score

AI assistance disclosure: AI assisted with research, drafting and the numerical analysis reported here. The source images are direct WebGL renders, not AI-generated images.

  • Screenshot MAE measures pixel differences, not accuracy
  • 6.407536 MAE over full image vs 18.313377 over mask
  • Averaging domain impacts reported score significantly

More from Sunday 1 November →