[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlaplus] Re: How do you think abstractly

Hi Akash, for TLA+ I think instead of set of integers you would like to give it as sequence of integers since sequence has a DOMAIN of unique integer indexes starting from 1 (which is actually the position of the elements in the sequence). But with sequences you can have repeat of the same integer and can change ordering as well which can give you different pairs. 

Like you, I am learning TLA+. I found TLA+ for me both for writing algorithms and specifying algorithm. It sometimes help me learn my algorithm better by creating it in TLA+. I hope this helps. Thanks.
On Thursday, December 7, 2023 at 10:52:50 AM UTC-8 Akash Gopalkrishnan wrote:
I'm trying to learn TLA+ to solve Leetcode problems?

Is TLA+ for writing algorithms or just specifying algorithms. In other words, do i learn the algorithm first, or can I use TLA+ to create an algorithm?

For example, for the classic 2 sums problem:
Given a set of integers. and a target value. Find the index of every pair of numbers that sum to the target value. Note: the index cannot be the same in the pair. 

Thanks so much for the help!

You received this message because you are subscribed to the Google Groups "tlaplus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tlaplus+unsubscribe@xxxxxxxxxxxxxxxx.
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/0c3b8b49-8fff-4596-a0f6-e3215c304d32n%40googlegroups.com.