exercism / lua

Exercism exercises in Lua.
https://exercism.org/tracks/lua
MIT License
41 stars 58 forks source link

Add palindrome-products practice exercise #521

Closed ryanplusplus closed 1 month ago

keiravillekode commented 1 month ago

We can save a couple of seconds using:

-      if n <= value and is_palindrome(n) then
+      if n > value then
+        break
+      end
+
+      if is_palindrome(n) then
-      if n >= value and is_palindrome(n) then
+      if n < value then
+        break
+      end
+
+      if is_palindrome(n) then
ryanplusplus commented 1 month ago

We can save a couple of seconds using:

-      if n <= value and is_palindrome(n) then
+      if n > value then
+        break
+      end
+
+      if is_palindrome(n) then
-      if n >= value and is_palindrome(n) then
+      if n < value then
+        break
+      end
+
+      if is_palindrome(n) then

Great catch, thanks!