[SOLVED] How do I generate a list of truthy expressions based from some numbers given? more details in Description
Dear SoloLearners, Please guide me on how to generate (or just ouput) any truthy expression based on some given numbers. My idea is by placing arbitrary operators in between the numbers to make the expression becomes truthy. Order of numbers or operators in the expression doesn't matter, as long as they form a truthy expression. I have no idea whether there is an algorithm to use unfortunately. Did think about permutation, but I have no idea how should permutation work with operators placement in an expression. For example (three numbers given - from user): 3, 15, 5 May generate/output something like these: 3 * 5 = 15 5 * 3 = 15 15 / 3 = 5 15 / 5 = 3 15 = 5 * 3 15 = 3 * 5 5 = 15 / 3 3 = 15 / 5 And more truthy expressions follows, if any, How can I do this? is this even possible? * Any hints, insights, guides or critics are welcome. Thank you in advance đ