Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Day 3 Exercise solution #108

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

pirates-alert
Copy link

This is the pull request for the Merging day 3 exercise into master. the same was given last week .
Please review and merge the same
questions solved are as below

  • longest-word-in-string
  • rotated-string
  • args-string
  • telephone-check
  • rot-13
  • abbreviate-string
  • add-big-integers

in the same order.

every solution includes a pseudo code as well as comments regarding the approach followed

I have tried to make the code as modular and abstract as possible . @ArfatSalman please review and let me know your opinion. I am up for some constructive criticism so all the remarks are welcome. Also @andrewlinfoot , @ahhda i would be really glad if you could guide me through the process.
Example of the Psudo code`/**

  • Please be sincear and let me know about all the mistakes i have made
  • please be a little kind as i am still a novoice and am still learning
  •                                                          @Bhargav Mantha
    
  • consider the example [ '539', '8', '201' ] in string literal format on convertion we get
  • Procedure/Approach/psudo code i am following
  • 1.Step one Split the string into specific numbers Strings based on \n =>[ '539', '8', '201' ]
  • 2.now get the greatest length in the above array array => in the abpove case its 3
    1. now add zeros to the places without the same for missing positions
  • ex---[ '539', '008', '201' ]
  • 4.now we generate a big number JSON with key as the units(0),once(1),tens(2) and so onn=>
  • {
    '0': [ '2', '0', '5' ],
    '1': [ '0', '0', '3' ],
    '2': [ '1', '8', '9' ]
    }
  • 5.now calculate the sume of each array
  • 6.pass On the carry
  • 7.reverse the array
  • VOOOLAA we have the sum of big integers
  • */`

references of the above are:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc

https://regex101.com/r/iZ2vL4/65

and ofcourse a lot of googeling and stack overflow

 /********************************\
@BhargavMantha  finished the 1st question of longest count of string in the sentance

\********************************/

The approach followed is mentioned in the comments of the code please refer and fo let me know your viewes
Function call has been removed which was accndently put
the second question rotated string or not check was also done
compleated the us phone validator
1.used a regx that tests the validity of the phone number
2.the following is the url for the same
<---------------url---------------->
https://regex101.com/r/iZ2vL4/65
<--------------url---------------->

You can play around with the tool for working of the same
:arrow_forward: :yum:
felling lucky
Added the Rot 13 question .

A small/atomic update for teliphone as well
Compleated the code to convert plain text to cipher text
Abbrivate String problem completed

@BhargavMantha

the psudo code is written in the comments
get the questions add  big integers
The sum of Big integer promlem compleated
@BhargavMantha

the how and when is describes in the comments
added trim functionality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants