Skip to content

Instantly share code, notes, and snippets.

@ASPSUNIL
ASPSUNIL / 00_End Course Capstone Project.md
Last active January 20, 2024 13:12 — forked from AbhiiAB/00_End Course Capstone Project.md
End Course Capstone Project - Module 2

End Course Capstone Project (Module 2)

Capstone Project Submission Instructions

  1. Login/Sign Up to your GitHub account.
  2. Fork this Gist from the Top-Right corner.
  3. Edit your Gist and paste/write the code solutions inside the respective functions.
  4. Share your Gist link in the submission form as per the instructions given.

- Do not make any changes in the first 3 lines

End.Course.Capstone.Project.Submission.Video.mp4
@ASPSUNIL
ASPSUNIL / 01_cbf-01_isPowerOfTwo.js
Last active January 20, 2024 16:57
Module 2: Coding Challenges Design and Analysis of Algorithms
/* Sarah, a dedicated mathematician and puzzle enthusiast, stumbled upon an intriguing challenge while delving into her research.
She contemplated the creation of an IsPowerOfTwo function, which takes a positive integer n as an argument and aims to discern whether
the given number qualifies as a power of two. In mathematical terms, an integer n is deemed a power of two if it can be represented as 2
raised to an integer exponent. For example, 8 is a power of two because it can be written as 2³.
*/
module.exports = { isPowerOfTwo };
function isPowerOfTwo(n) {