Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • \$\begingroup\$ I never programmed in Visual Basic, but it seems you can remove the space at If Not p.Contains(j)Then same like you did at If j.Contains(c)Then g=0 below. Also, If Not p.Contains(j)Then \n g=1 \n For Each c In i.ToString \n If j.Contains(c)Then g=0 \n Next \n If g Then Exit While \n End If can be shortened by removing g and using Exit While directly in the for-loop: If Not p.Contains(j)Then \n For Each c In i.ToString \n If j.Contains(c)Then Exit While \n Next \n End If, which will become 241 bytes by the looks of it. \$\endgroup\$ Commented Nov 9, 2017 at 18:20
  • \$\begingroup\$ @KevinCruijssen Definitely can remove the space to make it Contains(c)Then, I just missed it. I like what you're thinking, but I'm using g as a sentinel to see if the string contains the number or not. Your link gives the wrong answers, but I'll see if I can rework some of the inner logic along what you're thinking. \$\endgroup\$ Commented Nov 9, 2017 at 18:26
  • \$\begingroup\$ Ah oops.. It indeed fails.. Now it's only outputting the input. My bad. Shouldn't make these comments when it's evening and I'm tired from work. ;) \$\endgroup\$ Commented Nov 9, 2017 at 18:41