On most filesystems (not btrfs), the simple answer is:
find . -type d -links 2
In https://unix.stackexchange.com/questions/497185/how-to-find-only-directories-without-subdirectories there is a solution that works on btrfs, but it's unbearably ugly:
find . -type d \
\( -exec sh -c 'find "$1" -mindepth 1 -maxdepth 1 -type d -print0 | grep -cz "^" >/dev/null 2>&1' _ {} \; -o -print \)
There's an alternative to find called rawhide (rh) that makes this much easier:
rh 'd && "[ `rh -red %S | wc -l` = 0 ]".sh'
A slightly shorter/faster version is:
rh 'd && "[ -z \"`rh -red %S`\" ]".sh'
The above commands search for directories and then list their sub-directories and only match when there are none (the first by counting the number of lines of output, and the second by checking if there is any output at all per directory).
If you don't need support for btrfs, it's more like find but still shorter:
rh 'd && nlink == 2'
For a version that works on all filesystems as efficiently as possible:
rh 'd && (nlink == 2 || nlink == 1 && "[ -z \"`rh -red %S`\" ]".sh)'
On normal (non-btrfs) filesystems, this will work without the need for any additional processes for each directory, but on btrfs, it will need them. This is probably best if you have a mix of different filesystems including btrfs.
Rawhide (rh) is available from https://raf.org/rawhide or https://github.com/raforg/rawhide. It works at least on Linux, FreeBSD, OpenBSD, NetBSD, Solaris, macOS, and Cygwin.
Disclaimer: I am the current author of rawhide