mirror of
https://github.com/TheAlgorithms/C.git
synced 2026-02-12 05:44:32 +00:00
[PR #109] [CLOSED] New Algorithm - Repeating_1's_Square #337
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/TheAlgorithms/C/pull/109
Author: @ghodakegitanjali
Created: 12/17/2017
Status: ❌ Closed
Base:
master← Head:re📝 Commits (2)
90fac7cCreate Repeating_1's_Square6145329Update Repeating_1's_Square📊 Changes
1 file changed (+109 additions, -0 deletions)
View changed files
➕
Repeating_1's_Square(+109 -0)📄 Description
Added new algorithm to MISC. Fix for issue "Add more algorithms".
This program accepts user input of number of consecutive/repeating 1's. And then calculates it's square.
E.g. If user enters number of consecutive 1's = 5 then it calculates (11111)^2 = 123454321.
User may enter any number of consecutive 1's to be squared (less than or equal to 2^32 - 1).
This program uses innovative logic & pattern recognition to calculate the result within fraction of seconds.
Without this approach high end computers may also take few hours to calculate it. The result is calculated in three parts ' front' 'middle' & 'back'.
Similarly in future this can be extended with a logic to calculate the square of other consecutive/repeating numbers.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.