Sums of cubes and squares of sums
Given the positive integers 1:n, can you:
1. Compute twice the sum of the cubes of those numbers.
2. Subtract the square...
Make a Palindrome Number
Some numbers like 323 are palindromes. Other numbers like 124 are not. But look what happens when we add that number to a revers...
9年以上 前
解決済み
Reverse Run-Length Encoder
Given a "counting sequence" vector x, construct the original sequence y.
A counting sequence is formed by "counting" the entrie...
9年以上 前
解決済み
De-dupe
Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if
a =...
Check that number is whole number
Check that number is whole number
Say x=15, then answer is 1.
x=15.2 , then answer is 0. <http://en.wikipedia.org/wiki/Whole...
9年以上 前
解決済み
Is the paranthesis sequence balanced ?
Quantum mechanics and computer science are interested in <http://en.wikipedia.org/wiki/Bra%E2%80%93ket_notation bra-kets>. Today...
9年以上 前
解決済み
Writing a while loop
Write a while loop that continues to increment userValue by 5 until userValue is less than 0.
9年以上 前
解決済み
Double summation
Write two nested for loops to calculate the following double summation:
<<https://drive.google.com/uc?id=0B74PAULDIwwsWFhlNTV...
9年以上 前
解決済み
While loop with branching
Write a while loop that adjusts userValue while userValue is less than 0 or greater than 80. If userValue is greater than 80, th...
9年以上 前
解決済み
Compute change
A cashier distributes change using the maximum number of five dollar bills, followed by one dollar bills. Given amountToChange, ...