Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Coding puzzle 3
Message
From
06/06/2002 06:33:53
Walter Meester
HoogkarspelNetherlands
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00665235
Message ID:
00665328
Views:
22
Hi Nadya,

Instead of relying on SQL, here a faster method.
CREATE CURSOR Invert (un I)
SELECT t1
nLow = 0
INDEX ON Un TAG un && Only neccesary when the order is not right yet
SCAN
	FOR nT = nLow+1 TO Un-1
		INSERT INTO Invert VALUES (nT)
	ENDFOR
	nLow=un
ENDSCAN
Walter,


>Hi everybody,
>
>Ok, I was inspired by Peter. Here is a very simple problem, but neverless, let's find out the most elegant solution.
>
>There is a table with some sequence unique numbers:
>
>1
>3
>4
>8
>15
>...
>
>No pattern. Your goal would be to find out all missing numbers (of course, only whole numbers).
>
>For more advanced, I would make the task more difficult: find out all missing simple (? oops, what's the correct math term?) numbers. The latest problem seems complicated and I don't know solution myself yet...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform