Negate a number using addition operator by Kavit · November 15, 2015 Problem: Given a number X, flip it to -X. Time complexity : O ( X ) Logic : The negation can be implemented by adding -1, X times. Solution : Related Posts:How to test random dice roll function?Implement a power functionDetermine if a number is Odd or notRandom Dice Roll ChallengeFind all the prime factors for the given number