Rafael S.T. Vieira - MATLAB Cody - MATLAB Central

Rafael S.T. Vieira

8
Rank
122
Badges
48162
Score
1 – 50 of 7,209

Rafael S.T. Vieira submitted a Comment to Problem 45463. Word Ladder

Multiple solutions may exist for this problem, but the test suite only considers one correct. For instance, in test #2, y = {'mat' 'pat' 'put' 'aut' 'apt' 'ape'}; is a valid path from the word man to the word ape. This means we must use words in the order we find them as a priority queue.

on 29 Nov 2022

Rafael S.T. Vieira received Community Group Solver badge for Algorithm I

on 29 Nov 2022

Rafael S.T. Vieira submitted a Comment to Problem 45321. Kolakoski Sequence

I recommend solving the problem in the description if you haven't already. You can reuse your code here. You will need to make some changes, but it will be easier than solving this one from zero. Numberphile has a video about it if you are still stuck.

on 29 Nov 2022

Rafael S.T. Vieira submitted a Comment to Problem 45321. Kolakoski Sequence

So it's kind of like Kolakoski; the number still gives the length at pos n, like A000002. However, the following number is decided according to a base named "a". So, if a=[4,2,3], the remainder 0,1 or 2 (since a has length 3) will be mapped to 4,2,3 in this order.

on 29 Nov 2022

Rafael S.T. Vieira submitted a Comment to Problem 45426. The Tortoise and the Hare - 02

DP or GA require few test cases, or it can quickly grow beyond what is computational through current technology. For instance, 400 steps going ve or -ve, would require a tree with 2^401-1 nodes. It doesn't matter how we choose to traverse this tree, greedy or DP, it would only be fast to find a solution if there were many possible solutions (for this problem, there are just a few correct ones).

on 28 Nov 2022

Rafael S.T. Vieira submitted a Comment to Problem 45426. The Tortoise and the Hare - 02

This problem is not really about DP or GA, but it is still good.

on 28 Nov 2022

Rafael S.T. Vieira submitted a Comment to Problem 52629. Count the ways to draw non-intersecting chords between points on a circle

Tip: Counting is not as easy as we think. It depends on what we are counting. Counting primes up to n, for instance, is hard. However, It is easy when a pattern or formula can be found...

on 28 Nov 2022

Rafael S.T. Vieira submitted a Comment to Problem 52060. Identify Ruth-Aaron numbers

We don't need to have all primes up until n, just the equal sum of the prime factors of two sequential numbers. 77 and 78 are Ruth-Aaron Numbers because 7+11 == 2 + 3 + 13. 7*11 = 77 and 2*3*13 = 78. Only a number will be given as input. If it does not belong to a pair, return 'X,' or else If the lowest number of the pair is given (e.g., 77), your code should return R; if the highest is given, return A (e.g., 78). And if the number can be both, return RA. PS: The numberphile video is great but doesn't really help.

on 27 Nov 2022

Rafael S.T. Vieira submitted a Comment to Problem 51715. Iterate the sum of divisors and totient

The greatest challenge is to produce the most optimized code. Writing code that works is easy.

on 27 Nov 2022

1 – 50 of 7,209
Go to top of page