Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more

Squaring a number is multiplying it by itself . in this kata We Will not use the multiplication Operator or Even the Built-in POw Function .
sample input_output ::

3 >- 9
4 >- 16
5 >- 25

hint :
observe this kata Tags (Reveal EverThing ) !!

int sqauring (int num)
{
int times ; 
 times = num ;
 int squared ; 
 squared = 0;
 
 for (int i = 0 ; i <times ; i++ )
 {
 squared = squared + num ; 
 }
 
return squared ;
}
Code
Diff
  • def sortinggggggggggg (arr) :
      Soreteddddd = sorted (arr)
      print (Soreteddddd)
      return Soreteddddd
    sortinggggggggggg ([2,0,25,3])
    
  • 11 def sortinggggggggggg (arr) :
    22 Soreteddddd = sorted (arr)
    3+ print (Soreteddddd)
    33 return Soreteddddd
    44 sortinggggggggggg ([2,0,25,3])

Array and looping are in old-love story . Tonight we gonna play the game by separae them . given integer array , we want to sort it without the use of any kind of arrays .

Hint ::
You can write it in one line - Code

def sortinggggggggggg (arr) :
  Soreteddddd = sorted (arr)
  return Soreteddddd
sortinggggggggggg ([2,0,25,3])