Subset.rank_lexicographic() : rank_lexicographic() is a sympy Python library function that returns the lexicographic ranking of the subset.
Syntax :
sympy.combinatorics.subset.Subset.rank_lexicographic()
Return :
the lexicographic ranking of the subset.
Code #1 : rank_lexicographic() Example
from sympy.combinatorics import Permutation, Cycle
from sympy.combinatorics.subsets import Subset
a = Subset([ 'c' , 'd' ], [ 'geek' , 'for' , 'c' , 'd' ])
print ( "Subset a rank_lexicographic : " , a.rank_lexicographic)
|
Output :
Subset a rank_lexicographic : 14
Code #2 : rank_lexicographic() Example
from sympy.combinatorics import Permutation, Cycle
from sympy.combinatorics.subsets import Subset
a = Subset([ 2 , 3 , 4 ], [ 1 , 2 , 3 , 4 , 5 ])
print ( "Subset a rank_lexicographic : " , a.rank_lexicographic)
|
Output :
Subset a rank_lexicographic : 19
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
28 Aug, 2019
Like Article
Save Article