Classifying based on irregular number of features
The simple approach is:

To use a learning algorithm which can handle missing values. You should be careful about whether these missing values occur randomly or not though, as they could cause the model to be biased.
Triplets can be separated into individual features, there's no simple way to process them differently anyway.