Comment

Comment by 1vuio0pswjnm7

It is often said that K can beat the speed of C for some tasks.

The name of this site is "nsl" for No Stinking Loops.

Here is an array programming challenge for the K programmers reading this thread.

There are two large files A and B.

   File A
   AAAbjhOJxxxWXrCHt
   AAAsofxxxLqKbYOAwLMHG
   AAACgxxxOea
   AAAwfHjDtoJc
   AAAiCfYnbVXWhuvtEx
   AAAkzzQwvf
   AAAdjLalKFapoYAcGE
   AAAthGazmnfK
   etc.

   File B
   AAAwfHjDtoJc
   AAAbjhOJxxxWXrCHt
   AAAiCfYnbVXWhuvtEx
   AAACgxxxOea
   AAAkzzQwvf
   etc.
The task is:

What are the lines in B that are not in A?

Something like

   grep -vf B A
But without the stinking loops!

EDIT: File A,B formatting

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton