Post History
Ruby, 51 50 bytes -1 from Razetime ->p,n{while i=p.find{(_1*n).to_f%1==0} n*=i end n} Try it online!
Answer
#2: Post edited
# [Ruby], 51 bytes- ```ruby
- ->p,n{while i=p.find{(_1*n).to_f%1==0}
n=i*n- end
- n}
- ```
- [Try it online!][TIO-kt5ccwgv]
- [Ruby]: https://www.ruby-lang.org/
- [TIO-kt5ccwgv]: https://tio.run/##KypNqvyfZvtf165AJ6@6PCMzJ1Uh07ZALy0zL6W6pqxGo0wrT1OvJD8@TdXQ1taglivPNlMrjys1L4Urr/Z/gUKanka0iampvrFxkY6CoaG@IZjWNzQEUsb65hBBI7CYcVGsjoK5keZ/AA "Ruby – Try It Online"
- # [Ruby], <del>51</del> 50 bytes
- [-1 from Razetime](https://codegolf.codidact.com/comments/thread/4376#comment-13346)
- ```ruby
- ->p,n{while i=p.find{(_1*n).to_f%1==0}
- n*=i
- end
- n}
- ```
- [Try it online!][TIO-kt5ccwgv]
- [Ruby]: https://www.ruby-lang.org/
- [TIO-kt5ccwgv]: https://tio.run/##KypNqvyfZvtf165AJ6@6PCMzJ1Uh07ZALy0zL6W6pqxGo0wrT1OvJD8@TdXQ1taglivPNlMrjys1L4Urr/Z/gUKanka0iampvrFxkY6CoaG@IZjWNzQEUsb65hBBI7CYcVGsjoK5keZ/AA "Ruby – Try It Online"
#1: Initial revision
# [Ruby], 51 bytes ```ruby ->p,n{while i=p.find{(_1*n).to_f%1==0} n=i*n end n} ``` [Try it online!][TIO-kt5ccwgv] [Ruby]: https://www.ruby-lang.org/ [TIO-kt5ccwgv]: https://tio.run/##KypNqvyfZvtf165AJ6@6PCMzJ1Uh07ZALy0zL6W6pqxGo0wrT1OvJD8@TdXQ1taglivPNlMrjys1L4Urr/Z/gUKanka0iampvrFxkY6CoaG@IZjWNzQEUsb65hBBI7CYcVGsjoK5keZ/AA "Ruby – Try It Online"